package com.llstudio.creation.factory;

public class RuleConfigSource {

    public RuleConfig load(String ruleConfigFilePath) {
        String ruleConfigFileExtension = getFileExtension(ruleConfigFilePath);
        RuleConfigParser parser = RuleConfigParserFactory.createParser(ruleConfigFileExtension);

        String configText = readContentsFrom(ruleConfigFilePath);
        return parser.parse(configText);
    }

    private String getFileExtension(String ruleConfigFilePath) {
        return ruleConfigFilePath.split("\\.")[1];
    }

    private String readContentsFrom(String ruleConfigFilePath) {
        return "dummy contents";
    }

}
